<%--
  Created by IntelliJ IDEA.
  User: 754165242
  Date: 2022/3/7
  Time: 21:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<table width="400px" height="150px" border="1px" cellspacing="0px" align="center">
    <tr>
        <th>序号</th>
        <th>索引</th>
        <th>学号</th>
        <th>姓名</th>
        <th>爱好</th>
    </tr>
    <c:if test="${list!=null}">
        <%--
            for(User u:list){}
        --%>
        <%--
            ites:表示要遍历的集合对象
            var:从集合中获取到每一个对象
            begin:循环的开始索引
            end:循环的结束索引
            varStatus:循环状态
               count:序号
               index:循环的索引
            step:循环增量 默认是1
        --%>
        <c:forEach items="${list}" var="u"  step="2" varStatus="p">
            <%--循环体--%>
            <tr>
                <td>${p.count}</td>
                <td>${p.index}</td>
                <td>${u.uid}</td>
                <td>${u.name}</td>
                <td>${u.hobby}</td>
            </tr>
        </c:forEach>
    </c:if>


</table>
</body>
</html>
